3.1.22 \(\int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx\) [22]

3.1.22.1 Optimal result
3.1.22.2 Mathematica [B] (verified)
3.1.22.3 Rubi [A] (verified)
3.1.22.4 Maple [A] (verified)
3.1.22.5 Fricas [A] (verification not implemented)
3.1.22.6 Sympy [F]
3.1.22.7 Maxima [A] (verification not implemented)
3.1.22.8 Giac [B] (verification not implemented)
3.1.22.9 Mupad [B] (verification not implemented)

3.1.22.1 Optimal result

Integrand size = 21, antiderivative size = 113 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {3}{8} \left (a^2-5 b^2\right ) x-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \tan (c+d x)}{d}+\frac {\cos ^2(c+d x) (7 b-5 a \tan (c+d x)) (a+b \tan (c+d x))}{8 d}+\frac {\cos ^3(c+d x) \sin (c+d x) (a+b \tan (c+d x))^2}{4 d} \]

output
3/8*(a^2-5*b^2)*x-2*a*b*ln(cos(d*x+c))/d+b^2*tan(d*x+c)/d+1/8*cos(d*x+c)^2 
*(7*b-5*a*tan(d*x+c))*(a+b*tan(d*x+c))/d+1/4*cos(d*x+c)^3*sin(d*x+c)*(a+b* 
tan(d*x+c))^2/d
 
3.1.22.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(250\) vs. \(2(113)=226\).

Time = 3.12 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.21 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {b \left (\frac {3 \left (a^2-b^2\right ) \arctan (\tan (c+d x))}{b}+\frac {4 \left (-2 a^2+3 b^2\right ) \arctan (\tan (c+d x))}{b}+16 a \cos ^2(c+d x)-4 a \cos ^4(c+d x)+4 \left (2 a+\frac {a^2-3 b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}-b \tan (c+d x)\right )+4 \left (2 a+\frac {-a^2+3 b^2}{\sqrt {-b^2}}\right ) \log \left (\sqrt {-b^2}+b \tan (c+d x)\right )+\frac {2 \left (a^2-b^2\right ) \cos ^3(c+d x) \sin (c+d x)}{b}+\frac {3 (a-b) (a+b) \sin (2 (c+d x))}{2 b}+\frac {2 \left (-2 a^2+3 b^2\right ) \sin (2 (c+d x))}{b}+8 b \tan (c+d x)\right )}{8 d} \]

input
Integrate[Sin[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
 
output
(b*((3*(a^2 - b^2)*ArcTan[Tan[c + d*x]])/b + (4*(-2*a^2 + 3*b^2)*ArcTan[Ta 
n[c + d*x]])/b + 16*a*Cos[c + d*x]^2 - 4*a*Cos[c + d*x]^4 + 4*(2*a + (a^2 
- 3*b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] - b*Tan[c + d*x]] + 4*(2*a + (-a^2 + 3 
*b^2)/Sqrt[-b^2])*Log[Sqrt[-b^2] + b*Tan[c + d*x]] + (2*(a^2 - b^2)*Cos[c 
+ d*x]^3*Sin[c + d*x])/b + (3*(a - b)*(a + b)*Sin[2*(c + d*x)])/(2*b) + (2 
*(-2*a^2 + 3*b^2)*Sin[2*(c + d*x)])/b + 8*b*Tan[c + d*x]))/(8*d)
 
3.1.22.3 Rubi [A] (verified)

Time = 0.47 (sec) , antiderivative size = 171, normalized size of antiderivative = 1.51, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3042, 3999, 531, 2176, 2341, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \sin (c+d x)^4 (a+b \tan (c+d x))^2dx\)

\(\Big \downarrow \) 3999

\(\displaystyle \frac {b \int \frac {b^4 \tan ^4(c+d x) (a+b \tan (c+d x))^2}{\left (\tan ^2(c+d x) b^2+b^2\right )^3}d(b \tan (c+d x))}{d}\)

\(\Big \downarrow \) 531

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {\int \frac {(a+b \tan (c+d x)) \left (-4 \tan ^3(c+d x) b^5+3 \tan (c+d x) b^5-4 a \tan ^2(c+d x) b^4+a b^4\right )}{\left (\tan ^2(c+d x) b^2+b^2\right )^2}d(b \tan (c+d x))}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2176

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {\int \frac {8 \tan ^2(c+d x) b^6+16 a \tan (c+d x) b^5+\left (3 a^2-7 b^2\right ) b^4}{\tan ^2(c+d x) b^2+b^2}d(b \tan (c+d x))}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2341

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {\int \left (8 b^4+\frac {16 a \tan (c+d x) b^5+3 \left (a^2-5 b^2\right ) b^4}{\tan ^2(c+d x) b^2+b^2}\right )d(b \tan (c+d x))}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b \left (\frac {b^3 \tan (c+d x) (a+b \tan (c+d x))^2}{4 \left (b^2 \tan ^2(c+d x)+b^2\right )^2}-\frac {-\frac {3 b^3 \left (a^2-5 b^2\right ) \arctan (\tan (c+d x))+8 a b^4 \log \left (b^2 \tan ^2(c+d x)+b^2\right )+8 b^5 \tan (c+d x)}{2 b^2}-\frac {b^2 (a+b \tan (c+d x)) \left (7 b^2-5 a b \tan (c+d x)\right )}{2 \left (b^2 \tan ^2(c+d x)+b^2\right )}}{4 b^2}\right )}{d}\)

input
Int[Sin[c + d*x]^4*(a + b*Tan[c + d*x])^2,x]
 
output
(b*((b^3*Tan[c + d*x]*(a + b*Tan[c + d*x])^2)/(4*(b^2 + b^2*Tan[c + d*x]^2 
)^2) - (-1/2*(3*b^3*(a^2 - 5*b^2)*ArcTan[Tan[c + d*x]] + 8*a*b^4*Log[b^2 + 
 b^2*Tan[c + d*x]^2] + 8*b^5*Tan[c + d*x])/b^2 - (b^2*(a + b*Tan[c + d*x]) 
*(7*b^2 - 5*a*b*Tan[c + d*x]))/(2*(b^2 + b^2*Tan[c + d*x]^2)))/(4*b^2)))/d
 

3.1.22.3.1 Defintions of rubi rules used

rule 531
Int[(x_)^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symb 
ol] :> With[{Qx = PolynomialQuotient[x^m, a + b*x^2, x], e = Coeff[Polynomi 
alRemainder[x^m, a + b*x^2, x], x, 0], f = Coeff[PolynomialRemainder[x^m, a 
 + b*x^2, x], x, 1]}, Simp[(c + d*x)^n*(a*f - b*e*x)*((a + b*x^2)^(p + 1)/( 
2*a*b*(p + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(c + d*x)^(n - 1)*(a + b 
*x^2)^(p + 1)*ExpandToSum[2*a*b*(p + 1)*(c + d*x)*Qx - a*d*f*n + b*c*e*(2*p 
 + 3) + b*d*e*(n + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, d}, x] && IGt 
Q[n, 0] && IGtQ[m, 0] && LtQ[p, -1] && GtQ[n, 1] && IntegerQ[2*p]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2176
Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] : 
> With[{Qx = PolynomialQuotient[Pq, a + b*x^2, x], R = Coeff[PolynomialRema 
inder[Pq, a + b*x^2, x], x, 0], S = Coeff[PolynomialRemainder[Pq, a + b*x^2 
, x], x, 1]}, Simp[(d + e*x)^m*(a + b*x^2)^(p + 1)*((a*S - b*R*x)/(2*a*b*(p 
 + 1))), x] + Simp[1/(2*a*b*(p + 1))   Int[(d + e*x)^(m - 1)*(a + b*x^2)^(p 
 + 1)*ExpandToSum[2*a*b*(p + 1)*(d + e*x)*Qx - a*e*S*m + b*d*R*(2*p + 3) + 
b*e*R*(m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, d, e}, x] && PolyQ[Pq, x 
] && NeQ[b*d^2 + a*e^2, 0] && LtQ[p, -1] && GtQ[m, 0] &&  !(IGtQ[m, 0] && R 
ationalQ[a, b, d, e] && (IntegerQ[p] || ILtQ[p + 1/2, 0]))
 

rule 2341
Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq* 
(a + b*x^2)^p, x], x] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && IGtQ[p, -2]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3999
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_ 
), x_Symbol] :> Simp[b/f   Subst[Int[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), 
 x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/2]
 
3.1.22.4 Maple [A] (verified)

Time = 1.87 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.24

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin ^{7}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )}{d}\) \(140\)
default \(\frac {a^{2} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+2 a b \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )+b^{2} \left (\frac {\sin ^{7}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )}{d}\) \(140\)
risch \(2 i a b x +\frac {3 a^{2} x}{8}-\frac {15 b^{2} x}{8}+\frac {3 \,{\mathrm e}^{2 i \left (d x +c \right )} a b}{8 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{8 d}-\frac {i {\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{4 d}+\frac {3 \,{\mathrm e}^{-2 i \left (d x +c \right )} a b}{8 d}+\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{4 d}+\frac {4 i a b c}{d}+\frac {2 i b^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 a b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}-\frac {a b \cos \left (4 d x +4 c \right )}{16 d}+\frac {\sin \left (4 d x +4 c \right ) a^{2}}{32 d}-\frac {\sin \left (4 d x +4 c \right ) b^{2}}{32 d}\) \(224\)

input
int(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/d*(a^2*(-1/4*(sin(d*x+c)^3+3/2*sin(d*x+c))*cos(d*x+c)+3/8*d*x+3/8*c)+2*a 
*b*(-1/4*sin(d*x+c)^4-1/2*sin(d*x+c)^2-ln(cos(d*x+c)))+b^2*(sin(d*x+c)^7/c 
os(d*x+c)+(sin(d*x+c)^5+5/4*sin(d*x+c)^3+15/8*sin(d*x+c))*cos(d*x+c)-15/8* 
d*x-15/8*c))
 
3.1.22.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.21 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=-\frac {8 \, a b \cos \left (d x + c\right )^{5} - 32 \, a b \cos \left (d x + c\right )^{3} + 32 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) - {\left (6 \, {\left (a^{2} - 5 \, b^{2}\right )} d x - 13 \, a b\right )} \cos \left (d x + c\right ) - 2 \, {\left (2 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} - {\left (5 \, a^{2} - 9 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )} \]

input
integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="fricas")
 
output
-1/16*(8*a*b*cos(d*x + c)^5 - 32*a*b*cos(d*x + c)^3 + 32*a*b*cos(d*x + c)* 
log(-cos(d*x + c)) - (6*(a^2 - 5*b^2)*d*x - 13*a*b)*cos(d*x + c) - 2*(2*(a 
^2 - b^2)*cos(d*x + c)^4 - (5*a^2 - 9*b^2)*cos(d*x + c)^2 + 8*b^2)*sin(d*x 
 + c))/(d*cos(d*x + c))
 
3.1.22.6 Sympy [F]

\[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{2} \sin ^{4}{\left (c + d x \right )}\, dx \]

input
integrate(sin(d*x+c)**4*(a+b*tan(d*x+c))**2,x)
 
output
Integral((a + b*tan(c + d*x))**2*sin(c + d*x)**4, x)
 
3.1.22.7 Maxima [A] (verification not implemented)

Time = 0.30 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.13 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\frac {8 \, a b \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 8 \, b^{2} \tan \left (d x + c\right ) + 3 \, {\left (a^{2} - 5 \, b^{2}\right )} {\left (d x + c\right )} + \frac {16 \, a b \tan \left (d x + c\right )^{2} - {\left (5 \, a^{2} - 9 \, b^{2}\right )} \tan \left (d x + c\right )^{3} + 12 \, a b - {\left (3 \, a^{2} - 7 \, b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{8 \, d} \]

input
integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="maxima")
 
output
1/8*(8*a*b*log(tan(d*x + c)^2 + 1) + 8*b^2*tan(d*x + c) + 3*(a^2 - 5*b^2)* 
(d*x + c) + (16*a*b*tan(d*x + c)^2 - (5*a^2 - 9*b^2)*tan(d*x + c)^3 + 12*a 
*b - (3*a^2 - 7*b^2)*tan(d*x + c))/(tan(d*x + c)^4 + 2*tan(d*x + c)^2 + 1) 
)/d
 
3.1.22.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 5604 vs. \(2 (107) = 214\).

Time = 2.74 (sec) , antiderivative size = 5604, normalized size of antiderivative = 49.59 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=\text {Too large to display} \]

input
integrate(sin(d*x+c)^4*(a+b*tan(d*x+c))^2,x, algorithm="giac")
 
output
1/64*(3*pi*b^2*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2 
*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^5*tan(c)^5 + 24*a^2*d 
*x*tan(d*x)^5*tan(c)^5 - 120*b^2*d*x*tan(d*x)^5*tan(c)^5 + 3*pi*b^2*sgn(-2 
*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x) 
^5*tan(c)^5 + 6*pi*b^2*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*ta 
n(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^5*tan(c)^3 - 
3*pi*b^2*sgn(2*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d 
*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*tan(c)^4 + 6*pi*b^2*sgn(2 
*tan(d*x)^2*tan(c)^2 - 2)*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 
 2*tan(d*x) - 2*tan(c))*tan(d*x)^3*tan(c)^5 + 6*b^2*arctan((tan(d*x) + tan 
(c))/(tan(d*x)*tan(c) - 1))*tan(d*x)^5*tan(c)^5 - 6*b^2*arctan(-(tan(d*x) 
- tan(c))/(tan(d*x)*tan(c) + 1))*tan(d*x)^5*tan(c)^5 - 64*a*b*log(4*(tan(d 
*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 
+ tan(c)^2 + 1))*tan(d*x)^5*tan(c)^5 + 48*a^2*d*x*tan(d*x)^5*tan(c)^3 - 24 
0*b^2*d*x*tan(d*x)^5*tan(c)^3 + 6*pi*b^2*sgn(-2*tan(d*x)^2*tan(c) + 2*tan( 
d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^5*tan(c)^3 - 24*a^2*d*x*ta 
n(d*x)^4*tan(c)^4 + 120*b^2*d*x*tan(d*x)^4*tan(c)^4 - 3*pi*b^2*sgn(-2*tan( 
d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) - 2*tan(c))*tan(d*x)^4*ta 
n(c)^4 + 48*a^2*d*x*tan(d*x)^3*tan(c)^5 - 240*b^2*d*x*tan(d*x)^3*tan(c)^5 
+ 6*pi*b^2*sgn(-2*tan(d*x)^2*tan(c) + 2*tan(d*x)*tan(c)^2 + 2*tan(d*x) ...
 
3.1.22.9 Mupad [B] (verification not implemented)

Time = 4.15 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.12 \[ \int \sin ^4(c+d x) (a+b \tan (c+d x))^2 \, dx=x\,\left (\frac {3\,a^2}{8}-\frac {15\,b^2}{8}\right )+\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {\left (\frac {9\,b^2}{8}-\frac {5\,a^2}{8}\right )\,{\mathrm {tan}\left (c+d\,x\right )}^3+2\,a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2+\left (\frac {7\,b^2}{8}-\frac {3\,a^2}{8}\right )\,\mathrm {tan}\left (c+d\,x\right )+\frac {3\,a\,b}{2}}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}+\frac {a\,b\,\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{d} \]

input
int(sin(c + d*x)^4*(a + b*tan(c + d*x))^2,x)
 
output
x*((3*a^2)/8 - (15*b^2)/8) + (b^2*tan(c + d*x))/d + ((3*a*b)/2 - tan(c + d 
*x)*((3*a^2)/8 - (7*b^2)/8) - tan(c + d*x)^3*((5*a^2)/8 - (9*b^2)/8) + 2*a 
*b*tan(c + d*x)^2)/(d*(2*tan(c + d*x)^2 + tan(c + d*x)^4 + 1)) + (a*b*log( 
tan(c + d*x)^2 + 1))/d